import React from "react";


function CommonForm (Comp) {
  class Wrap extends React.Component {
    constructor () {
      super();
      this.state = {};
      this.handleChange = this.handleChange.bind(this);
    }

    handleChange (key, value) {
      this.setState({
        [key]: value
      });
    }

    render () {
      return (
        <Comp state={this.state} handleChange={this.handleChange} {...this.props} />
      );
    }

  }

  return Wrap;
}

export default CommonForm;


